<!doctype html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
    <link rel="stylesheet" href="/static/css/app.css">
    <title>Hello, world!</title>
</head>

<body>
    <form class="container" id="formdata">
        <input type="hidden" name="id" value="{$info.id}">
        <div class="form-group">
            <label for="">姓名</label>
            <input type="text" name="nickname" value="{$info.nickname}" class="form-control" id="nickname">
        </div>

        <div class="form-group">
            <label for="">选择公司</label>
            <select class="form-control" name="company_id" id="" id="company_id">
                <optgroup label="">
                {volist name="company" id="vo"}
                    <option value="{$vo.id}" {eq name="info.company_id" value="$vo.id"}selected{/eq}>{$vo.company_name}</option>
                {/volist}
                </optgroup>
            </select>
        </div>

        <div class="form-group">
            <label for="">选择部门</label>
            <select multiple class="form-control" name="department_id[]" id="" size="7" id="department_id">
                <optgroup label="">
                {volist name="department" id="vo"}
                    <option value="{$vo.id}" {in name="vo.id" value=":str2arr($info.department_id)"}selected{/in}>{$vo.department_name}</option>
                {/volist}
                </optgroup>
            </select>
        </div>


        <div class="form-group">
            <label for="">选择职位</label>
            <select multiple class="form-control" name="position_id[]" id="" size="30" id="position_id">
                {volist name="position" id="vo"}
                <optgroup label="{$key}">
                    {volist name="vo.child" id="v"}
                    <option value="{$v.id}" {in name="v.id" value=":str2arr($info.position_id)"}selected{/in}>{$v.position_name}</option>
                    {/volist}
                </optgroup>
                {/volist}

            </select>
        </div>

        <div class="form-group">
            <label for="">等级</label>
            <div class="form-check">
                <input class="form-check-input" type="radio" name="level" id="level1" value="1" checked>
                <label class="form-check-label" for="level1">员工</label> &emsp; &emsp;
                <input class="form-check-input" type="radio" name="level" id="level2" value="2">
                <label class="form-check-label" for="level2">组长</label> &emsp; &emsp;
                <input class="form-check-input" type="radio" name="level" id="level3" value="3">
                <label class="form-check-label" for="level3">负责人</label>
            </div>
        </div>

        <button type="button" class="btn btn-primary" id="submit">Submit</button>
    </form>
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.js"></script>
    <!-- <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> -->
    <!-- <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
    <script>
        $('#submit').click(function() {
            var params = $('#formdata').serializeArray();
            console.log(params);
            $.post("{:url('/users/users_edit')}", params, function(res) {
                layer.msg(res.msg)

                console.log(res);
            })
        })
    </script>
</body>

</html>